//
//  HeadView.m
//  News
//
//  Created by weige on 16/5/29.
//  Copyright © 2016年 weige. All rights reserved.
//

#import "HeadView.h"
#import "HeadModel.h"
#import "focusModel.h"
@interface HeadView()<UIScrollViewDelegate>

@property (strong,nonatomic) UIScrollView *imageScroll ;
@property (strong,nonatomic) UIPageControl *pagec ;
@property (strong,nonatomic) NSTimer *timer ;
@end
@implementation HeadView
+(NSArray *)loadDataImage:(NSString *)str
{
    NSMutableArray *arr=[NSMutableArray array];
    NSString *path=[ContentFileFillPath ContentFileFillPaths:@"首页焦点按钮"];
    NSData *data=[NSData dataWithContentsOfFile:path];
    NSDictionary *dict=[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
    HeadModel  *head=[HeadModel mj_objectWithKeyValues:dict];
    for (id ff in head.data.focus) {
        [arr addObject:ff[str]];
    }
    return arr;
}

+(NSArray *)loadDataIco:(NSString *)str
{
    NSMutableArray *arr=[NSMutableArray array];
    NSString *path=[ContentFileFillPath ContentFileFillPaths:@"首页焦点按钮"];
    NSData *data=[NSData dataWithContentsOfFile:path];
    NSDictionary *dict=[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
    HeadModel  *head=[HeadModel mj_objectWithKeyValues:dict];
    for (id ff in head.data.icons) {
        [arr addObject:ff[str]];
    }
    return arr;
}
+(NSArray *)loadHomeData:(NSString *)str
{
    
    NSString *path=[ContentFileFillPath ContentFileFillPaths:@"首页焦点按钮"];
    NSData *data=[NSData dataWithContentsOfFile:path];
    NSDictionary *dict=[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
    HeadModel  *head=[HeadModel mj_objectWithKeyValues:dict];
    return  head.data.activities;
  
}
/*!
 *  @author weige, 16-06-01 13:06:06
 *
 *  @brief 加载商品
 *
 *  @return 返回商品对象【字典转模型】
 */
+(NSArray *)loadGoodData
{
    NSString *path=[ContentFileFillPath ContentFileFillPaths:@"首页新鲜热卖"];
    NSData *data=[NSData dataWithContentsOfFile:path];
    NSDictionary *dict=[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
    GoodData *good=[GoodData mj_objectWithKeyValues:dict];

    
    return [Goods mj_objectArrayWithKeyValuesArray:good.data];
    

}
+(NSArray *)loadGoodOrder
{
    NSString *path=[ContentFileFillPath ContentFileFillPaths:@"MyOrders"];
    NSData *data=[NSData dataWithContentsOfFile:path];
    NSDictionary *dict=[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
    MineOrderInfoMoldel *order=[MineOrderInfoMoldel mj_objectWithKeyValues:dict];
    
    
    return [MineOrder mj_objectArrayWithKeyValuesArray:order.data];
    
    
}


@end
